//
//  XYSystem.h
//  ZhaoQiPei
//
//  Created by baiye on 2017/1/24.
//  Copyright © 2017年 XiangYun. All rights reserved.
//

#ifndef AS_SINGLETON
#define AS_SINGLETON(__class)\
- (instancetype)sharedInstance;\
+ (instancetype)sharedInstance;
#endif

#ifndef DEF_SINGLETON
#define DEF_SINGLETON(__class)\
- (instancetype)sharedInstance\
{\
return [__class sharedInstance];\
}\
+ (instancetype)sharedInstance\
{\
static dispatch_once_t once;\
static __class * __singleton__;\
dispatch_once( &once, ^{ __singleton__ = [[[self class] alloc] init]; } );\
return __singleton__;\
}
#endif
